package org.alan7yg.aop_sample.web.controller;

import lombok.extern.slf4j.Slf4j;
import org.alan7yg.aop_sample.CommonHttpResponse;
import org.alan7yg.aop_sample.RestHandle;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.alan7yg.aop_sample.CommonHttpResponse.ok;
import static org.alan7yg.aop_sample.RespCode.SUCCESS;

/**
 * Created by alan on 8/29/16.
 */
@RestController
@RequestMapping("/")
@Slf4j
public class SampleController {

    @RequestMapping("/t1_assemble_object")
    public CommonHttpResponse<String> t1_assemble_object() {
        return new CommonHttpResponse<>(SUCCESS, "success");
    }

    @RestHandle
    @RequestMapping("/t2_aop_success")
    public CommonHttpResponse<String> t2_aop_success() {
        return ok("success");
    }

}
